package com.dgy.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgy.project.mapper.ProjectPlanMapper;
import com.dgy.project.domain.ProjectPlan;
import com.dgy.project.service.IProjectPlanService;

/**
 * 预期研究成果Service业务层处理
 *
 * @author ccc
 * @date 2025-03-19
 */
@Service
public class ProjectPlanServiceImpl implements IProjectPlanService
{
    @Autowired
    private ProjectPlanMapper projectPlanMapper;

    /**
     * 查询预期研究成果
     *
     * @param id 预期研究成果主键
     * @return 预期研究成果
     */
    @Override
    public ProjectPlan selectProjectPlanById(Long id)
    {
        return projectPlanMapper.selectProjectPlanById(id);
    }

    /**
     * 查询预期研究成果列表
     *
     * @param projectPlan 预期研究成果
     * @return 预期研究成果
     */
    @Override
    public List<ProjectPlan> selectProjectPlanList(ProjectPlan projectPlan)
    {
        return projectPlanMapper.selectProjectPlanList(projectPlan);
    }

    /**
     * 新增预期研究成果
     *
     * @param projectPlan 预期研究成果
     * @return 结果
     */
    @Override
    public int insertProjectPlan(ProjectPlan projectPlan)
    {
        projectPlan.setCreateTime(DateUtils.getNowDate());
        return projectPlanMapper.insertProjectPlan(projectPlan);
    }

    /**
     * 修改预期研究成果
     *
     * @param projectPlan 预期研究成果
     * @return 结果
     */
    @Override
    public int updateProjectPlan(ProjectPlan projectPlan)
    {
        projectPlan.setUpdateTime(DateUtils.getNowDate());
        return projectPlanMapper.updateProjectPlan(projectPlan);
    }

    /**
     * 批量删除预期研究成果
     *
     * @param ids 需要删除的预期研究成果主键
     * @return 结果
     */
    @Override
    public int deleteProjectPlanByIds(Long[] ids)
    {
        return projectPlanMapper.deleteProjectPlanByIds(ids);
    }

    /**
     * 删除预期研究成果信息
     *
     * @param id 预期研究成果主键
     * @return 结果
     */
    @Override
    public int deleteProjectPlanById(Long id)
    {
        return projectPlanMapper.deleteProjectPlanById(id);
    }
}
